import request from "../../utils/request";
enum API{
    HISTORY='/moment/viewRecords?access_token=',
    ROOMALL='/trainingCenter/plans/search/findByUserId?access_token=',
    DELECT='/task/tasks?access_token=',
    MYCLASS='/trainingCenter/plans/search/findByUserId?access_token=',
    SEARCH='/moment/viewRecords?access_token=',
    CLASSLIST='/trainingCenter/planContents/search/findByPlanId?access_token='
}
let access_token = 'ef03e20b-d084-449d-bb28-0cbd0ed36bcc'
// 获取历史
export const reqHistory = (pageSize:number,pageNum:number)=>request.get(API.HISTORY+access_token+`&pageSize=${pageSize}`+`&pageNum=${pageNum}`)
// 获取我的练习室全部
export const reqRoomAll = (pageSize:number,pageNum:number,type:string,myListCategory:string)=>request.get(API.ROOMALL+access_token+`&pageSize=${pageSize}`+`&pageNum=${pageNum}`+`&type=${type}`+`&myListCategory=${myListCategory}`)
// 删除
export const reqDelHistory = (ids:any)=>request.post(API.DELECT+access_token,{name:"batchDeleteSomeViewRecords",params:{ids}})
// 历史关键字搜索
export const reqSearch = (pageSize:number,pageNum:number,keyword:string)=>request.get(API.SEARCH+access_token+`&pageSize=${pageSize}`+`&pageNum=${pageNum}`+`&keyword=${keyword}`)
// 跳转入课堂
export const reqClass = (pageSize:number,pageNum:number,planId:string)=>request.get(API.CLASSLIST+access_token+`&pageSize=${pageSize}`+`&pageNum=${pageNum}`+`&planId=${planId}`)
